home *** CD-ROM | disk | FTP | other *** search
/ Aminet 19 / Aminet 19 (1997)(GTI - Schatztruhe)[!][Jun 1997].iso / Aminet / util / boot / GetMouseInput.lha / GetMouseInput / GetMouseInput.doc < prev    next >
Encoding:
Text File  |  1997-03-24  |  5.7 KB  |  178 lines

  1. **************************** GetMouseInput V1.1  ***************************
  2.  
  3.                                (same as V1.01)
  4.  
  5.                    * REVISED DOCUMENTATION - 24 Mar 1997 *
  6.  
  7.                       Program revision date:01 Jan 1997
  8.  
  9.                              ©1996 Tim Jackson
  10.  
  11.  
  12. What is GetMouseInput?
  13. ----------------------
  14. GetMouseInput is a simple program to read the state of the mouse buttons.
  15. It returns a value corresponding to the button(s) pressed which can be read
  16. from an AmigaDOS® script.
  17.  
  18.  
  19. What do I need to run it?
  20. -------------------------
  21. Any Amiga with WB2.04+.  I think.
  22.  
  23.  
  24. What files should I have?
  25. -------------------------
  26. In this distribution, there should be the following files:
  27.  
  28. GetMouseInput              * The main program
  29. GetMouseInput.doc          * This document file
  30. GetMouseInput.doc.info
  31. GetMouseInput.guide        * An AmigaGuide version of this file
  32. GetMouseInput.guide.info
  33. SampleScript               * An example startup-sequence
  34.  
  35.  
  36. Copyright & Distribution
  37. ------------------------
  38. GetMouseInput is FREEWARE.  That means you can copy it and freely distribute
  39. it (including uploading to a BBS/Aminet etc.), as long as:
  40.  
  41. - You don't charge anything for it (except a nominal charge for disk and
  42.   copying)
  43. - You include all the files listed above in any distribution.
  44. - You don't modify any files.
  45.  
  46. (For inclusion on compilation CDs or magazine coverdisks/cover CDs, contact
  47. me.  Any other queries, contact me.  No permission is necessary for
  48. inclusion on Aminet or Fred Fish CDs.)
  49.  
  50. The copyright of the program remains with me at all times.
  51.  
  52.  
  53. Disclaimer
  54. ----------
  55. You use this program entirely at your own risk.  The author will accept no
  56. responsibility whatsoever for any loss or damage caused by this program
  57. including but not limited to loss of or damage to data.
  58.  
  59.  
  60. Why write GetMouseInput?
  61. ------------------------
  62. I wrote GetMouseInput as a quick and easy solution to a problem I had.
  63. Although some games will install onto a hard drive, some will not run from
  64. Workbench for various reasons (VGA screen modes, lack of memory etc.).
  65. Therefore they have to be either loaded from floppy or started from AmigaDOS
  66. before Workbench is loaded.  This is inconvenient, so I decided to write a
  67. simple menu system as a script file.  However, there remained the problem of
  68. how to start the menu.  I decided a good way was to hold down a mouse button
  69. as the computer booted.  So, I wrote GetMouseInput to enable me to do this.
  70.  
  71.  
  72. OK, what does it do exactly?
  73. ----------------------------
  74. When it is started, GetMouseInput will check the state of the mouse buttons
  75. (for the mouse in port 1, just in case you wondered...) and then store a
  76. number corresponding to the button(s) pressed in a global environment
  77. variable called MouseInput.
  78.  
  79. You can then check the returned number and perform an appropriate action.
  80. See below for information about how to do this.
  81.  
  82.  
  83. How do I use it?
  84. ----------------
  85. You need to call GetMouseInput from the CLI.  It will need to called from
  86. within  a script file if it is to be of any use.  You can create a script
  87. file in any text editor (e.g. Ed).
  88.  
  89. GetMouseInput will not do anything visible but will put a number in an
  90. environment variable called MouseInput as follows:
  91.  
  92. No.   Button(s) pressed
  93. ---   -----------------
  94. 0     None
  95. 1     Left
  96. 2     Right
  97. 3     Left + Right
  98. 4     Middle
  99. 5     Left + Middle
  100. 6     Right+ Middle
  101. 7     Left + Middle + Right
  102.  
  103. You can check the number returned by using the AmigaDOS 'If' command, for
  104. example:
  105.  
  106. If $MouseInput EQ 1
  107.    ; Left button was pressed
  108. EndIf
  109.  
  110. So, as you can see, it is very easy to set up a whole range of functions
  111. each accessed by pressing a different combination of mouse buttons.  You can
  112. therefore set up your startup-sequence to load different setups of Workbench
  113. or start menus etc. easily.  To help you, I have included an example script
  114. file which I use as my startup-sequence.  This file executes different
  115. startup files according to whether you press no buttons, the left button or
  116. the right button.  You can of course modify this to include a middle mouse
  117. button etc.
  118.  
  119. However, all these examples on how to use GetMouseInput are only
  120. suggestions; there are many uses for it.  You could even set up a loop in a
  121. script file and recursively call GetMouseInput until a certain mouse button
  122. combination is pressed, therefore allowing a 'wait for mouse click' function
  123. from AmigaDOS!
  124.  
  125. By the way, if you want to do things properly, you can unset the MouseInput
  126. environment variable after you have finished with it by using:
  127.  
  128. UnSetEnv MouseInput
  129.  
  130.  
  131. Future Improvements
  132. -------------------
  133. I don't have any ideas for any future improvements to GetMouseInput as it's
  134. such a simple program.  If you have any, I'd be glad to hear from you and
  135. implement them.
  136.  
  137.  
  138. Known Bugs
  139. ----------
  140. None.  But do let me know if GetMouseInput does anything naughty such as
  141. totally screwing up your system.
  142.  
  143.  
  144. Version History
  145. ---------------
  146. V1.00 Original version.  Bit of a naughty bug which tended to cause a
  147.       software failure.
  148. V1.01 FIRST PUBLIC RELEASE.  Bug fixed.
  149. V1.1  Same as V1.01 but with Style Guide compliant version number :)
  150.  
  151.  
  152. » Contact me! «
  153. ---------------
  154. If you've found GetMouseInput useful, TELL ME ABOUT IT!  The program is
  155. freeware; there is nothing to be paid but I'd like to hear from you anyway.
  156. Of course, any donations will be gratefully accepted.
  157.  
  158. In fact, why not send me your opinion of GetMouseInput on a postcard from
  159. your local area, especially if you live outside the U.K.
  160.  
  161. Any bug reports or suggestions for improvement should also be sent to the
  162. below address:
  163.  
  164. Tim Jackson
  165. 4 Charnock View Road
  166. Sheffield
  167. S12 3HJ
  168. ENGLAND
  169.  
  170.  
  171. Or, e-mail me at:
  172.  
  173. tim_jackson@bigfoot.com
  174.  
  175. On the occasions that I have access to IRC, my usual nick is Arcline and I
  176. tend to hang around on IRCnet (try irc.demon.co.uk).
  177.  
  178.